-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
change toLower to toLowerANSI #410
base: master
Are you sure you want to change the base?
Conversation
Huh? Why? |
its faster than toLower because it only expects characters up to 255 https://community.bistudio.com/wiki/toLowerANSI
|
@@ -11,7 +11,7 @@ GVAR(CalloutCacheNamespace) = call CBA_fnc_createNamespace; | |||
if !(".p3d" in _string) then { | |||
_string = _string + ".p3d"; | |||
}; | |||
GVAR(blockSuppressionModelCache) setVariable [toLower _string, true]; | |||
GVAR(blockSuppressionModelCache) setVariable [toLowerANSI _string, true]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here we probably should not do that, in case there is someone using none standard ANSI characters for the file path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I remember, setVariable only supports ASCII characters as Variable names. So that should not be an issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
private _yeet = false call CBA_fnc_createNamespace;
private _string = "\правда\model.p3d";
if ((_string select [0,1]) isEqualTo "\") then {
_string = [_string, 1] call CBA_fnc_substr;
};
if !(".p3d" in _string) then {
_string = _string + ".p3d";
};
_yeet setVariable [toLowerANSI _string, true];
allVariables _yeet
returns ["������������\model.p3d"]
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that means obfuscated pbos will not work well here.
When merged this pull request will: